package com.kaibes.orm.curd;

import java.util.ArrayList;
import java.util.List;

public class InsertBuilder {

    private String tableName;
    protected List<Object> datas;
    public InsertBuilder() {
        datas = new ArrayList<>();
    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public InsertBuilder setDatas(List datas) {
        this.datas = datas;
        return this;
    }
    
    public InsertBuilder addData(Object data) {
        datas.add(data);
        return this;
    }
    
    public InsertBuilder setTableName(String tableName) {
        this.tableName = tableName;
        return this;
    }
    
    public Insert build() {
        Insert insert = new Insert();
        insert.setTableName(tableName);
        insert.setDatas(datas);
        return insert;
    }
    
    public static InsertBuilder newBuilder() {
        return new InsertBuilder();
    }
    
}
